package com.zmzncs.lmtc.module.order.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zmzncs.lmtc.module.order.pojo.order_trade_record.OrderTradeRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zmzncs.lmtc.module.order.pojo.order_trade_record.OrderTradeRecordDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 订单-订单交易记录 Mapper 接口
 * </p>
 *
 * @author 任建波
 * @since 2020-09-24
 */
@Repository
public interface OrderTradeRecordDao extends BaseMapper<OrderTradeRecord> {

    /**根据订单号查询订单交易记录*/
    List<OrderTradeRecordDTO> getOrderTradeRecordByOrderCode(String orderCode);
    /**根据订单号和流水号查询订单交易记录*/
    OrderTradeRecordDTO getOrderTradeRecordByOrderCodeTradeNo(@Param("orderCode") String orderCode, @Param("tradeNo") String tradeNo);
    /**根据订单号查询订单支付成功的交易记录*/
    List<OrderTradeRecordDTO> getPaidOrderTradeRecordByOrderCode(String orderCode);
    /**查询出场时支付成功的交易记录*/
    List<OrderTradeRecordDTO> getOutPayByOrderCode(String orderCode);
    /**查询余额交易记录总数量*/
    Long getOrderTradeRecordCount(Long customerId);

    /**分页查询用户余额订单记录*/
    IPage<OrderTradeRecordDTO> getOrderTradeRecordRecharge(Page page, @Param("customerId") Long customerId);
    /**分页查询垫付未支付订单记录*/
    IPage<OrderTradeRecordDTO> getOrderTradeRecordBehalfPay(Page page, @Param("customerId") Long customerId);

    /**获取欠费订单*/
    List<OrderTradeRecordDTO>  getArrearsOrder(@Param("carNumberList") List<String> carNumberList);

}
